<div id="sm-parameter-man" style="height:100%">
</div>
<script type="text/javascript">
    Ext.define('MyData', {
        extend: 'Ext.data.Model',
        fields: ['sid', 'ename', 'cname', 'val']
    });
    
    var mystore = Ext.create('Ext.data.Store', {
        pageSize: 10,
        model: 'MyData',
        proxy: {
            actionMethods: 'post',
            type: 'ajax',
            url: 'sm/findParameter.do',
            reader: {
                root: 'items',
                totalProperty: 'total'
            }
        }
    })
    
    var grid = Ext.create('Ext.grid.Panel', {
        height: 'auto',
		layout:'fit',
        border: 0,
        autoScroll: true,
        store: mystore,
        loadMask: true,
        selModel: new Ext.selection.CheckboxModel,
        columns: [{
            header: '编码',
            dataIndex: 'ename'
        }, {
            header: '名称',
            dataIndex: 'cname',
            width: 150
        }, {
            header: '值',
            dataIndex: 'val'
        }],
        dockedItems: [{
            xtype: 'pagingtoolbar',
            store: mystore,
            dock: 'bottom',
            emptyMsg: '没有数据',
            displayInfo: true,
            displayMsg: '当前显示{0}-{1}条记录 / 共{2}条记录 ',
            beforePageText: '第',
            afterPageText: '页/共{0}页'
        }, {
            xtype: 'toolbar',
            items: [{
                iconCls: 'icon-add',
                text: '新增',
                scope: this,
                handler: function(){
                }
            }, {
                iconCls: 'icon-delete',
                text: '删除',
                itemId: 'delete',
                scope: this,
                handler: function(){
                }
            }]
        }],
        listeners: {},
        renderTo: 'sm-parameter-man'
    })
    
    //初始加载第1页
    mystore.loadPage(1);
</script>
